#include<stdio.h>
#include "MyStack.h"

static void Qprint(Queue* q)
{
	assert(q);
	QNode* cur = q->head;
	printf("head<-");
	while (cur)
	{
		printf("%d<-", cur->data);
		cur = cur->next;
	}
	printf("tail\n");
}

void test1()
{
	MyStack* st = myStackCreate();
	myStackPush(st, 1);
	myStackPush(st, 2);
	printf("top = %d\n", myStackTop(st));
	myStackPush(st, 3);
	printf("qa:"); Qprint(st->qa); printf("qb:"); Qprint(st->qb);
	printf("top = %d\n", myStackTop(st));
	myStackPush(st, 4);
	printf("qa:"); Qprint(st->qa); printf("qb:"); Qprint(st->qb);
	printf("top = %d\n", myStackTop(st));
	myStackPop(st);
	printf("qa:"); Qprint(st->qa); printf("qb:"); Qprint(st->qb);
	myStackPop(st);
	printf("qa:"); Qprint(st->qa); printf("qb:"); Qprint(st->qb);

	printf("top = %d\n", myStackTop(st));


	myStackFree(st);
}

int main()
{
	test1();
	return 0;
}